package ocrsTest;

import static org.junit.Assert.*;

import ocrs.Course;
import ocrs.Location;
import ocrs.Student;
import ocrs.Time;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import com.google.appengine.api.datastore.Email;
import com.google.appengine.api.datastore.PostalAddress;

public class CourseTest {

	Course test,test2;
	@Before
	public void setUp() throws Exception {
		test = new Course();
		String[] temp = {"String1","String2","String3"};
		test2 = new Course("CMSC","FALL",2010,40,"Software Design",1,"Dr. Miner",new Location("UMBC","ITE",123),"MWF",new Time("9:00","12:00",true),
							52,4,"BLAH","9/12/2012","1/1/2013",temp);
	}

	@After
	public void tearDown() throws Exception {
		test = test2 = null;
	}

	@Test
	public void testCourse() {
		assertTrue(test != null);
	}

	@Test
	public void testCourseConstructor() {
		assertTrue(test2!=null && test2.getCapacity() == 40 && test2.getClassName() == "Software Design" && test2.getCourseExcerpt() == "BLAH"
					&& test2.getCourseID()=="CMSC" && test2.getDaysHeld() == "MWF");
	}

	@Test
	public void testAddAndGetStudent() {
		test2.addStudent(new Student("name","id",new PostalAddress("address"),new Email("email@email.com"),"password","none","none"));
		String[] temp = {"name"};
		assertArrayEquals(test2.getStudentList(),temp);
	}

	@Test
	public void testGetCourseID() {
		assertTrue(test2.getCourseID() == "CMSC");
	}

	@Test
	public void testGetSemester() {
		assertTrue(test2.getSemester() == "FALL");
	}

	@Test
	public void testGetYear() {
		assertTrue(test2.getYear() == 2010);
	}

	@Test
	public void testGetCapacity() {
		assertTrue(test2.getCapacity() == 40);
	}

	@Test
	public void testGetClassName() {
		assertTrue(test2.getClassName() == "Software Design");
	}

	@Test
	public void testGetSectionNumber() {
		assertTrue(test2.getSectionNumber() == 1);
	}

	@Test
	public void testGetInstructorName() {
		assertTrue(test2.getInstructorName() == "Dr. Miner");
	}

	@Test
	public void testGetTeachingLocation() {
		assertTrue(test2.getTeachingLocation()!=null);
	}

	@Test
	public void testGetDaysHeld() {
		assertTrue(test2.getDaysHeld().equals("MWF"));
	}

	@Test
	public void testGetTimeHeld() {
		assertTrue(test2.getTimeHeld() != null);
	}

	@Test
	public void testGetNumberOfWeeks() {
		assertTrue(test2.getNumberOfWeeks() == 52);
	}

	@Test
	public void testGetNumberOfCredits() {
		assertTrue(test2.getNumberOfCredits() == 4);
	}

	@Test
	public void testGetCourseExcerpt() {
		assertTrue(test2.getCourseExcerpt().equals("BLAH"));
	}

	@Test
	public void testGetStartDate() {
		assertTrue(test2.getStartDate().equals("9/12/2012"));
	}

	@Test
	public void testGetEndDate() {
		assertTrue(test2.getEndDate().equals("1/1/2013"));
	}

	@Test
	public void testGetPrerequisitesNeedForThisCourse() {
		String[] temp = {"String1","String2","String3"};
		assertArrayEquals(test2.getPrerequisitesNeedForThisCourse(),temp);
	}

	@Test
	public void testGetWaitList() {
		assertTrue(test2.getWaitList().length == 0);
	}

	@Test
	public void testGetDropAndWithdrawList() {
		fail("Not yet implemented"); // TODO
	}

	@Test
	public void testSetCourseID() {
		fail("Not yet implemented"); // TODO
	}

	@Test
	public void testSetSemester() {
		fail("Not yet implemented"); // TODO
	}

	@Test
	public void testSetYear() {
		fail("Not yet implemented"); // TODO
	}

	@Test
	public void testSetCapacity() {
		fail("Not yet implemented"); // TODO
	}

	@Test
	public void testSetClassName() {
		fail("Not yet implemented"); // TODO
	}

	@Test
	public void testSetSectionNumber() {
		fail("Not yet implemented"); // TODO
	}

	@Test
	public void testSetInstructorName() {
		fail("Not yet implemented"); // TODO
	}

	@Test
	public void testSetTeachingLocation() {
		fail("Not yet implemented"); // TODO
	}

	@Test
	public void testSetDaysHeld() {
		fail("Not yet implemented"); // TODO
	}

	@Test
	public void testSetTimeHeld() {
		fail("Not yet implemented"); // TODO
	}

	@Test
	public void testSetNumberOfWeeks() {
		fail("Not yet implemented"); // TODO
	}

	@Test
	public void testSetNumberOfCredits() {
		fail("Not yet implemented"); // TODO
	}

	@Test
	public void testSetCourseExcerpt() {
		fail("Not yet implemented"); // TODO
	}

	@Test
	public void testSetStartDate() {
		fail("Not yet implemented"); // TODO
	}

	@Test
	public void testSetEndDate() {
		fail("Not yet implemented"); // TODO
	}

	@Test
	public void testSetPrerequisitesNeedForThisCourse() {
		fail("Not yet implemented"); // TODO
	}

	@Test
	public void testSetDropAndWithdrawList() {
		fail("Not yet implemented"); // TODO
	}

	@Test
	public void testCompareTo() {
		fail("Not yet implemented"); // TODO
	}

	@Test
	public void testToString() {
		fail("Not yet implemented"); // TODO
	}

	@Test
	public void testShowMoreInformation() {
		fail("Not yet implemented"); // TODO
	}

	@Test
	public void testAssignGrades() {
		fail("Not yet implemented"); // TODO
	}

	@Test
	public void testGetGrade() {
		fail("Not yet implemented"); // TODO
	}

}
